package com.hospital.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 就诊记录实体类
 *
 * @author Hospital Management System
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_medical_record")
public class MedicalRecord extends BaseEntity {

    /**
     * 病历编号
     */
    @TableField("record_no")
    private String recordNo;

    /**
     * 挂号ID
     */
    @TableField("registration_id")
    private Long registrationId;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 用户姓名
     */
    @TableField(exist = false)
    private String userName;

    /**
     * 医生ID
     */
    @TableField("doctor_id")
    private Long doctorId;

    /**
     * 医生姓名
     */
    @TableField(exist = false)
    private String doctorName;

    /**
     * 科室ID
     */
    @TableField("department_id")
    private Long departmentId;

    /**
     * 科室名称
     */
    @TableField(exist = false)
    private String departmentName;

    /**
     * 主诉
     */
    @TableField("chief_complaint")
    private String chiefComplaint;

    /**
     * 现病史
     */
    @TableField("present_illness")
    private String presentIllness;

    /**
     * 既往史
     */
    @TableField("past_history")
    private String pastHistory;

    /**
     * 体格检查
     */
    @TableField("physical_examination")
    private String physicalExamination;

    /**
     * 辅助检查
     */
    @TableField("auxiliary_examination")
    private String auxiliaryExamination;

    /**
     * 诊断结果
     */
    @TableField("diagnosis")
    private String diagnosis;

    /**
     * 治疗方案
     */
    @TableField("treatment_plan")
    private String treatmentPlan;

    /**
     * 医嘱
     */
    @TableField("medical_advice")
    private String medicalAdvice;

    /**
     * 就诊时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("visit_time")
    private LocalDateTime visitTime;

    /**
     * 记录状态（0草稿 1已完成）
     */
    @TableField("status")
    private Integer status;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 是否需要住院
     */
    @TableField("need_hospitalization")
    private Boolean needHospitalization;

    /**
     * 病房ID
     */
    @TableField("ward_id")
    private Long wardId;

    /**
     * 病房名称
     */
    @TableField(exist = false)
    private String wardName;

    /**
     * 床位号
     */
    @TableField("bed_number")
    private Integer bedNumber;

    /**
     * 预计住院天数
     */
    @TableField("estimated_days")
    private Integer estimatedDays;

    /**
     * 入院时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("admission_time")
    private LocalDateTime admissionTime;

    /**
     * 预计出院时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("estimated_discharge_time")
    private LocalDateTime estimatedDischargeTime;

    /**
     * 实际出院时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("actual_discharge_time")
    private LocalDateTime actualDischargeTime;

    /**
     * 住院状态（0未住院 1已入院 2已出院）
     */
    @TableField("hospitalization_status")
    private Integer hospitalizationStatus;
} 